#ifndef _WA_LOG_UTIL_H_
#define _WA_LOG_UTIL_H_

#include <stdarg.h>
#include <string.h>
#include "SilmLogApi.h"

#ifdef _WIN32
#define UtilSprintf         sprintf_s
#else
#define UtilSprintf         snprintf
#endif//_WIN32

extern const char *UtilGetLogTypeString(unsigned int type);
extern void UtilSysLog(unsigned int logType, const char *format, ...);

//************************************
// Function:  UtilParseFilename
// Returns:   void
// Description: Parse absolute filename, and return directory  filename  suffix name
// Parameter:
//            IN const char * pFullFilename: absolute filename
//            INOUT char * pDirBuffer OPTIONAL: save directory
//            IN int dirBufLen OPTIONAL: 
//            INOUT char * pNameBuffer OPTIONAL: save filename
//            IN int nameBufLen OPTIONAL: 
//            INOUT char * pExtBuffer OPTIONAL: save suffix name
//            IN int extBufLen OPTIONAL: 
//************************************
extern void UtilParseFilename(IN const char *pFullFilename, 
    INOUT char *pDirBuffer OPTIONAL, IN int dirBufLen OPTIONAL,
    INOUT char *pNameBuffer OPTIONAL, IN int nameBufLen OPTIONAL,
    INOUT char *pExtBuffer OPTIONAL, IN int extBufLen OPTIONAL);

//************************************
// Function:  UtilStringBeginWith
// Returns:   bool
// Description:
// Parameter:
//            IN const char * string:
//            IN const char * substring:
//************************************
extern bool UtilStringBeginWith(IN const char *string, IN const char *substring);

//************************************
// Function:  UtilStringEndWith
// Returns:   bool
// Description: 
// Parameter:
//            IN const char * string: 
//            IN const char * substring:
//************************************
extern bool UtilStringEndWith(IN const char *string, IN const char *substring);

#endif//_WA_LOG_UTIL_H_
